package Hxw3DEngine.utils
{
	import Hxw3DEngine.asset.AssetType;

	public class AssetUtils
	{
		public function AssetUtils()
		{
		}
		
		/**
		 *判断该文件的资源类型 
		 */	
		private static var displayType:Array = ["swf","png","jpg"];
		private static var textType:Array = ["xml","txt"];
		
		public static function getAssetType(ur:String):String{
			var start:int = ur.lastIndexOf(".")+1;
			var end:int = ur.length;
			var str:String = ur.slice(start,end);
			str = str.toLowerCase();
			if(displayType.indexOf(str) > -1){
				return AssetType.RESOURCE_DISPLAY;
			}else if(textType.indexOf(str) >-1){
				return AssetType.RESOURCE_TXT;
			}else{
				return AssetType.RESOURCE_BYTEARRAY;
			}
		}
		
	}
}